<template>
    <div>{{ designTempletList }}</div>
</template>

<script>
  import Vue from 'vue'

  export default {
    name: 'index',
    data() {
      return {
        designTempletList: []
      }
    },
    created() {
      console.log('问卷调查 -> created')
      this.init()
    },
    methods: {
      init() {
        if (sessionStorage.ENV) {
          Vue.prototype.$ENV = JSON.parse(sessionStorage.ENV)
          this.list()
        } else {
          this.$router.push({
            path: '/login'
          })
        }
      },
      list() {
        var user = Vue.prototype.$ENV
        this.axios.get('/qs/designTemplet/list?userId=' + user.userId).then(
          response => {
            if (response.data && response.data.code === 200) {
              this.designTempletList = response.data.data
            } else {
              console.error(response.data.message)
            }
          }, error => {
            console.error(error)
          })
      }
    }
  }
</script>

<style>

</style>
